#include<iostream>
using namespace std;
const int N = 2e5 + 10;
int n, m;
int l[N], r[N];
bool st[N];
struct node
{
	string s;
	int x;
}S[N];
int main()
{
	cin >> n >> m;
	int cnt1 = 0, cnt2 = 0;
	for (int i = 0; i < m; i++) {
		string s;
		int x;
		cin >> s >> x;
		S[i] = { s,x };
	}
	for (int i = m - 1; i >= 0; i--) {
		string s = S[i].s;
		int x = S[i].x;
		if (st[x])continue;
		if (s[0] == 'L') {
			l[++cnt1] = x;
		}
		else {
			r[++cnt2] = x;
		}
		st[x] = 1;
	}
	for (int i = 1; i <= cnt1; i++) {
		cout << l[i] << " ";
	}
	for (int i = 1; i <= n; i++) {
		if (!st[i]) {
			cout << i << " ";
		}
	}
	for (int i = cnt2; i >= 1; i--) {
		cout << r[i] << " ";
	}
	return 0;
}
